<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Home</title>
</head>
<body>
    <h2>Home</h2>
    <hr>

    <h4>变量：</h4>
    <p>name: {{ name }}</p>
    <p>age: {{ age }}</p>
    <p>likes: {{ likes }}</p>

    <hr>
    <h4>标签：</h4>
    {% if  age >= 18 %}
        <p>{{ name }}已经成年了</p>
    {% elif age >= 6 %}
        <p>{{ name }}可以上学了</p>
    {% else %}
        <p>{{ name }}还是小孩</p>
    {% endif %}

    <hr>
    <h4>for循环</h4>
    {% for like in likes %}
    	<p>{{ like }}</p>

        index: {{ loop.index }},
        index0: {{  loop.index0 }},
        revindex: {{ loop.revindex }}
        revindex0:{{ loop.revindex0 }}
    {% endfor %}

    <hr>
    <h4>for循环2</h4>
    {% for like in likes %}
    	{% if loop.first %}
    		<p style="color: red">{{ like }}</p>
        {% elif loop.last %}
            <p style="color: green">{{ like }}</p>
    	{% endif %}
        {% else %}
        <b>else</b>
    {% endfor %}


</body>
</html>